package com.bzframework.pro.enums;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

/**
 * @Author bingzhong
 * @Date 2025/4/21 18:08
 * @Description
 */
@Getter
@RequiredArgsConstructor
public enum OrderStatusEnum {

    /**
     * 待支付
     */
    toBePaid(1, "未付款"),
    /**
     * 已支付
     */
    paid(2, "已付款"),

    /**
     * 已关闭
     */
    closed(6, "已关闭");

    private final int status;

    private final String text;

    public static OrderStatusEnum of(String text) {

        for (OrderStatusEnum value : OrderStatusEnum.values()) {
            if (value.text.equals(text)) {
                return value;
            }
        }
        return OrderStatusEnum.toBePaid;

    }


}
